﻿using System;
using System.Windows.Forms;

namespace Excel_2010_Measure_Reader
{
    public partial class CheckOptionsDialog : Form
    {
        public CheckOptionEnum CheckOption { get; set; }

        public CheckOptionsDialog()
        {
            CheckOption = CheckOptionEnum.Cancel;

            InitializeComponent();
        }

        private void acceptButton_Click(object sender, EventArgs e)
        {
            foreach (var control in grpCheckOptions.Controls)
            {
                var radioButton = control as RadioButton;

                if (radioButton != null)
                {
                    if (radioButton.Checked)
                    {
                        CheckOption = (CheckOptionEnum) Enum.Parse(typeof(CheckOptionEnum), radioButton.Tag.ToString());
                    }
                }
            }
            Close();
        }
    }
}
